<?PHP
ob_start();
session_start();
include('common/connection.php');
$adminId=$_POST['u_name'];
$adminPass=$_POST['password'];
	 
	$query="SELECT * FROM `admin` WHERE admin_user_name='".trim($adminId)."' AND admin_pass='".trim($adminPass)."'";
	$result = mysql_db_query($db_name,$query);
	$data= mysql_fetch_object($result);
	$adminUser=$data->admin_user_name;
	$adminPassword=$data->admin_pass;
	$adminid=$data->admin_id;
	
	if($adminPassword!=$adminPass)
	{
		header("location: admin/index.php?mess=1");
	}
	else
	{
		$SESS_Admin=$adminid;
		//session_register("SESS_Admin");
		$_SESSION['SESS_Admin']=$adminid;
		$url="location: containeradmin.php?area=admin&action=adminhome";
		header($url);
		
	}
?>
